package com.example.xuefeng.repository;

import com.example.xuefeng.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.data.rest.core.annotation.RestResource;

@RepositoryRestResource(path = "user")
public interface UserRepository extends JpaRepository<User,Long> {
    @RestResource(path="username",rel="username")
    public User findByUsername(@Param("username") String username);
}
